using System;

namespace CL
{
	public interface ICLUpdate
	{
	}

	public interface ICLUpdateSystem : ICLSystemType
	{
		void Run(CLEntity o);
	}

    public abstract class CLUpdateSystem<T> : CLSystemObject, ICLUpdateSystem where T : CLEntity, ICLUpdate
    {
        public int GetInstanceQueueIndex()
        {
            return CLInstanceQueueIndex.Update;
        }

        public void Run(CLEntity o)
        {
            this.Update((T)o);
        }

        public Type SystemType()
        {
            return typeof(ICLUpdateSystem);
        }

        public Type Type()
        {
            return typeof(T);
        }
        protected abstract void Update(T self);
    }
}
